<template>
  <div>
    <form>
      <label>姓名：</label>
      <input type="text" v-model="name"><br><br>

      <label>年龄：</label>
      <input type="number" v-model.number="age"><br><br>

      <label>身高：</label>
      <input type="number" v-model.number="height">(米)<br><br>

      <label>体重：</label>
      <input type="number" v-model="stro">(公斤)<br><br>

      <label>病史：</label>
      <input type="text" v-model="his"><br><br>

      <button @click="fn1">诊断</button>
    </form>

    <p>患者  的诊断结果：{{state}}</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      name:'',
      age:'',
      height:'',
      stro:'',
      his:'',
      state:'无'
    }
  },
  methods: {
    fn1(){
      // console.log(this.height)
      if(this.stro/(this.height^2)>=18.5&&this.stro/(this.height^2)<=23.9){
        this.state='健康'
      }else {
        this.state='不健康'
      }
    }
  }
}
</script>